/* 
 * File:   CentralDirectory.h
 * Author: enriqueantezana
 *
 * Created on 5 de junio de 2013, 14:47
 */

#ifndef CENTRALDIRECTORY_H
#define	CENTRALDIRECTORY_H

#include "FileHeader.h"

const unsigned int CENTRAL_DIRECTORY_SIGNATURE = 0x02014b50;
const unsigned short CENTRAL_DIRECTORY_SIZE = 46;

struct CentralDirectory
{
public:
    CentralDirectory(FileHeader* header);
    ~CentralDirectory();
    CentralDirectory(CentralDirectory* other);
    int size();

    int fileHeaderSignature_;
    short versionMadeBy_;
    short versionNedded_;
    short flag_;
    short compressionMethod_;
    unsigned short lastModificationTime_;
    unsigned short lastModificationDate_;
    int crc_;
    int compressedSize_;
    int uncompressedSize_;
    short fileNameLength_;
    short extraFieldLength_;
    short fileCommentLength_;
    short diskNumber_;
    short internalFileAttributes_;
    int externalFileAttributes_;
    int relativeOffset_;
    char* fileName_;
    char* extraField_;
    char* fileComment_;

};

std::ostream& operator<<(std::ostream& out, CentralDirectory& centralDirectory);

#endif	/* CENTRALDIRECTORY_H */

